﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="lcsign.Web.documentinfo.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
     <script type="text/javascript">
         function saveDoc() {
             var DocumentID = "<%=mFileName %>";
            if (DocumentID == "") {
                DocumentID = iStylePDF.Documents.ActiveDocument.FileInformation.FileName;
                if (DocumentID == "")
                    DocumentID = "新建文档.pdf";
            }
            var url = encodeURI("<%=mHttpUrl %>" + "FileSave.aspx?DocumentID=" + DocumentID);
            var result = iStylePDF.HttpClient.UpLoadToServer(url);
            if (result == 200) {
                alert("保存文档成功！");
                window.location.href = "Default.aspx";
            }
            else {
                alert("保存失败，返回值为" + result);
            }
        }
 </script>



</head>
    <script type="text/javascript" language="javascript" for=iStylePDF event="OnApplicationCreate(App)">
        //控件创建完成事件
        //控件使用的语言
        var lcid = App.Options.Lcid;
        //控件是否高亮域
        //App.Options.HighlightField = false;
        //隐藏下侧的导航工具栏
        App.Options.NavBarVisible = false;
        //隐藏左侧的命令工具栏
        App.Options.TabCommandBarVisible = false;
        //是否允许键盘快捷键操作
        App.Options.EnableAccelerator = true;
        //是否允许打开的文档记录历史记录中
        App.Options.HistoryEnabled = false;
        //设置单文档模式
        App.Options.DocumentsLayout = 0;
        //是否显示起始页
        App.Options.StartPageVisible = false;
        //打开文档100%显示
        //App.Options.PageZoomMode = 1;
        App.Options.UserName = "青岛信元物和供应链有限公司";

        var DocumentID = "<%=mFileName %>";
    if (DocumentID != "") {
        var url = encodeURI("<%=mHttpUrl %>" + "FileLoad.aspx?DocumentID=" + DocumentID);
        iStylePDF.HttpClient.DownLoadToFile(url);
    }
    </script>
<body>
    
    <div>
        <a href="#" onclick="saveDoc();">保存文档到服务器</a>
     <div id="showlist" style="vertical-align: top; height: 600px; margin-right: auto;
        margin-left: auto;"><object  id="iStylePDF" width="100%" height="100%" classid="CLSID:7017318C-BC50-4DAF-9E4A-10AC8364C315" codebase="iStylePDF.cab#version=3,0,6,2155"></object></div>
    </div>
   
</body>
</html>
